package mylab.io.core.context;

import io.netty.channel.Channel;
import mylab.io.base.context.DasContext;
import mylab.io.base.model.Msg;
import mylab.io.base.model.Terminal;
import mylab.io.base.property.DasProperties;
import mylab.io.core.cache.ChannelCache;


public interface CoreContext<P extends DasProperties, M extends Msg> extends DasContext<P, M> {

    static <P extends DasProperties, M extends Msg> CoreContext<P, M> newContext(P params) {
        return new DefaultCC<>(params);
    }

    ChannelCache getChannelCache();

    void initChannel(Channel channel);

    Channel getChannel(Terminal terminal);

}
